<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <title>Show</title>
</head>

<body>

<?php
include('conn.php');

$user_query = mysql_query( "SELECT * FROM user" )
    or die ('Database user(updated) query failed!');
?>

<table width="100%" border="1">
    <tr>
        <th width="5%" bgcolor="#CCCCCC" scope="col">学号</th>
<!--        <th width="5%" bgcolor="#CCCCCC" scope="col">Name</th> -->
        <th width="8%" bgcolor="#CCCCCC" scope="col">网站</th>
        <th width="8%" bgcolor="#CCCCCC" scope="col">在线时间</th>
        <th width="8%" bgcolor="#CCCCCC" scope="col">得到票数</th>
    </tr>
    <?php while ($row = mysql_fetch_row($user_query)) { ?>
    <tr>
        <td><?php echo $row[0]; ?></td>
<!--        <td><?php echo $row[1]; ?></td>  -->
        <td><?php if ($row[2] != null) {
   echo '<a href="';
   if (strstr($row[2], 'http://') == null) { echo 'http://'; }
       echo $row[2].'" target="_blank">'.$row[2].'</a>'; }
?></td>
        <td>
<?php
if ($row[3] == null) {
    echo '全天';
} else {
    echo $row[3];
}
?>
        </td>
        <td><?php echo $row[4]; ?></td>
    </tr>
    <?php } ?>
</table>
<p><a href="index.html">回到登录页面</a></p>
</body>
